package cn.wolfcode.shop.domain;

import cn.wolfcode.shop.basedomain.BaseDomian;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Setter
@Getter
public class Property extends BaseDomian{

    private Long catalogId;

    private String name;

    private Integer sort=0;

    private Integer type=0;

    private List<PropertyValue> propertyValues =new ArrayList<>();


    public String getJsonData(){
        Map<String,Object> map  = new HashMap();
        map.put("id",getId());
        map.put("name",name);
        map.put("catalogId",catalogId);
        map.put("sort",sort);
        map.put("type",type);
        return JSON.toJSONString(map);
    }

}